/*
 * @Author: Huangxianlong
 * @Date: 2023-09-08 14:21:10
 * @LastEditors: Huangxianlong
 * @LastEditTime: 2023-09-08 16:45:03
 * @FilePath: \agricultural-vue3-ts\src\utils\loadBMap.ts
 * @Description:
 */
export function BMPGL(ak) {
  return new Promise(function (resolve, reject) {
    window.init = function () {
      // eslint-disable-next-line
      resolve(BMapGL);
    };
    const script = document.createElement("script");
    script.type = "text/javascript";
    script.src = `http://api.map.baidu.com/api?v=3.0&type=webgl&ak=${ak}&callback=init`;
    script.onerror = reject;
    document.head.appendChild(script);
  });
}
